package se.ramfelt.psnfriends;

import java.util.List;

import java.util.Timer;
import java.util.TimerTask;

import android.app.Service;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.IBinder;
import android.preference.PreferenceManager;
//import android.util.Log;

public class PlaystationNetworkService extends Service {

    //private static String LOG_TAG = PlaystationNetworkService.class.getSimpleName();
    
    private Timer timer = new Timer();
    private Thread thread;
//    
//    private PlaystationNetwork network;
    private boolean isLoggedIn = false;
//
//    private List<Friend> friends;
    
    @Override
    public IBinder onBind(Intent arg0) {
        return null;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        
        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
//        network = new PlaystationNetwork(
//                preferences.getString(getString(R.string.pref_account_username), ""),
//                preferences.getString(getString(R.string.pref_account_password), ""));
        isLoggedIn = false;
        timer.scheduleAtFixedRate(new TimerTask(){
            @Override
            public void run() {
                thread.start();
            }}, 0, 10000);
        //Log.i(LOG_TAG, "Timer started.");
    }
//
//    @Override
//    public void onDestroy() {
//        if (timer != null) { 
//            timer.cancel();
//            //Log.i(LOG_TAG, "Timer stopped.");
//        }
//        super.onDestroy();
//    }
//
//
//    public List<Friend> getFriends() {
//        return friends;
//    }
}
